package com.future.lottie.base;

import android.os.Bundle;
import android.view.LayoutInflater;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.viewbinding.ViewBinding;

/**
 * @author xuchuanting
 * Create on 2020/7/16 11:34
 */
public abstract class BaseActivity<A extends ViewBinding> extends AppCompatActivity {


    protected A mViewBinding;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mViewBinding = createViewBinding(LayoutInflater.from(this));
        setContentView(mViewBinding.getRoot());
        initView();
        initData();
    }


    protected abstract A createViewBinding(LayoutInflater inflater);

    protected abstract void initView();

    protected abstract void initData();
}
